#pragma once
#include "InternalsPlugin.hpp"
#include "Sprite.hpp"
#include "DriverInfo.hpp"
#include "TimingInfo.hpp"
#include "TypeDefs.hpp"

  class DriverDetail
{
public:


	DriverDetail(const char *pRootPath, const char *pIniUIFilename, const char *pIniDriverMappingFilename, const char *pIniVehiculeClassMappingFilename);
	virtual ~DriverDetail(void);

	void init(const ScreenInfoV01 &info, float ratio, float ratioWidth, float ratioHeight, Sprite spriteList[], Sprite logoList[], Sprite avatarList[]);
	void render(int profileIndex, const ScreenInfoV01 &info, const LPD3DXFONT *fontList, const D3DCOLOR *colorList, Sprite spriteList[], Sprite logoList[], Sprite avatarList[]); 
	void updateData(const VehicleScoringInfoV01 &vinfo, const DriverInfo &di, TimingInfo & timingInCategory);

	

//private:
  bool initialized;
 
 const char *rootPath;
  char iniUIFilename[800];
  const char *iniDriverMappingFilename;
  const char *iniVehiculeClassMappingFilename;

  int nbProfiles;
  PluginProfile profiles[10];

  RECT tmpRect;

  // driver data
 bool available;

 ImageData bgImageData;
  char mLastDriverName[32];
  unsigned char mPlace;

  // place text
  bool placeAvailable;
  TextData placeTextData;
  char mPlaceStr[4];

  // first place specificities
  bool firstPlaceAvailable;
  ImageData firstPlaceImageData;
  TextData firstPlaceTextData;
  // first place specificities (ina category)
  bool firstPlaceInCatAvailable;
  ImageData firstPlaceInCatImageData;
  TextData firstPlaceInCatTextData;
  bool firstPlaceInCat;

  // driver number
  bool numberAvailable;
  TextData numberTextData;
  char mDriverNumStr[6];

  // driver name
  bool nameAvailable;
  TextData nameTextData;
  char mDriverName[33];

  // team name
  bool teamAvailable;
  TextData teamTextData;
  char mDriverTeam[33];
  ImageData nameAvatarData;
  int nameOriginalAvatarIndex;

  // class sticker
  bool classAvailable;
  ImageData classImageData;
  TextData classTextData;
  char mClassStickerName[33];
  int classOriginalImageColorIndex;
  int classOriginalTextColorIndex;

    // class name
  bool classNameAvailable;
  TextData classNameTextData;
  char mClassName[33];
  ImageData classLogoData;
  int classOriginalLogoIndex;
  // tools
  char tmp[1000];

};

